package com.hospital.hospitalmedicalrecordservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 接诊表
 * </p>
 *
 * @author 韩天雨
 * @since 2020-10-20
 */
@Data
@Accessors(chain = true)
public class Medicalrecord extends Model<Medicalrecord> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 患者用户
     */
    private Integer sickpersonId;

    /**
     * 就诊状态
     */
    private Integer medicalrecordstatusId;

    /**
     * 接诊类型
     */
    private Integer medicalrecordtypeId;

    /**
     * 医生
     */
    private Integer doctorId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createtime;

    /**
     * 患者姓名
     */
    @TableField(exist = false)
    private String name;

    /**
     * 患者卡号
     */
    @TableField(exist = false)
    private String serialnumber;

    /**
     * 年龄
     */
    @TableField(exist = false)
    private Integer age;

    /**
     * 出生日期
     */
    @TableField(exist = false)
    private Date birth;

    /**
     * 性别0女1男
     */
    @TableField(exist = false)
    private Integer sex;

    /**
     * 手机号码
     */
    @TableField(exist = false)
    private String phone;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date sickcreatetime;
    @TableField(exist = false)
    private String statusname;//接诊状态
    @TableField(exist = false)
    private String typename;
    @TableField(exist = false)
    private String doctname;
    @TableField(exist = false)
    private String subname;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
